<?php
    header('Access-Control-Allow-Origin: *');
    header('Content-Type:application/json;charset=utf-8');
    $con = mysqli_connect("127.0.0.1", "root", "root", "mydb");
    $classId = $_GET['classId'];
    $uId = $_GET['stuId'];
    $signInfo = array();
    $sql = "SELECT s.stu_name,le.create_at,le.id,le.s_id FROM stu_info as s INNER JOIN lesson_sign as le on s.stu_id = le.s_id WHERE l_id = '$classId' AND s.stu_id = '$uId' ORDER BY le.create_at asc;";
    $res = mysqli_query($con,$sql);
    while($row = mysqli_fetch_array($res)){
        $item = array(
            'stu_name' => $row['stu_name'],
            'create_at' => $row['create_at'],
            'sign_id' => $row['id'],
            'stu_id' => $row['s_id']
        );
        array_push($signInfo,$item);
    }
    echo json_encode(array(
        'signInfo'=>$signInfo
    ));
    mysqli_close($con);
?>